#include<stdio.h>
typedef struct{
  int numitor;
  int numarator;
}Rational;
Rational produs(Rational,Rational);
Rational suma(Rational,Rational);
Rational diff(Rational,Rational);
Rational q(Rational,Rational);
int cmmdc(int, int);
Rational simplifica(Rational);
int main()
{
Rational a,b;
a.numarator=1;
b.numarator=1;
a.numitor=2;
b.numitor=4;
Rational rez;
rez=produs(a,b);
printf("\n%d/%d\n",rez.numarator,rez.numitor);
rez=suma(a,b);
printf("\n%d/%d\n",rez.numarator,rez.numitor);
rez=diff(a,b);
printf("\n%d/%d\n",rez.numarator,rez.numitor);
rez=q(a,b);
printf("\n%d/%d\n",rez.numarator,rez.numitor);
return 0;
}


Rational produs(Rational n,Rational m)
{
Rational r;
r.numarator=n.numarator*m.numarator;
r.numitor=n.numitor*m.numitor;
return r;
}
Rational suma(Rational a,Rational b)
{
Rational r;
r.numarator=a.numarator*b.numitor+a.numitor*b.numarator;
r.numitor=a.numitor*b.numitor;
return r;
}
Rational diff(Rational a,Rational b)
{
b.numarator=-b.numarator;
return suma(a,b);
}
Rational q(Rational a,Rational b)
{
Rational t;
t.numarator=b.numitor;
t.numitor=b.numarator;
return produs(a,t);
}




